/*
	*	Original script by: Shafiul Azam
	*	Version 4.0
	*	Modified by: Luigi Balzano

	*	Description:
	*	Inserts Countries and/or States as Dropdown List
	*	How to Use:

		In Head section:
		----------------
		<script type= "text/javascript" src = "countries.js"></script>
		
		In Body Section:
		----------------
		Select Country (with states):   <select id="country" name ="country"></select>
			
		Select State: <select name ="state" id ="state"></select>

        Select Country (without states):   <select id="country2" name ="country2"></select>
			
		<script language="javascript">
			populateCountries("country", "state");
			populateCountries("country2");
		</script>

	*
	*	License: Free to copy, distribute, modify, whatever you want to.
	*	Aurthor's Website: http://bdhacker.wordpress.com
	*
*/

// States
var state_arr = new Array("Andaman and Nicobar Island", "Andhra Pradesh", "Arunachal Pradesh", "Assam ", "Bihar", "Chandigarh", " Chattisgarh", "Dadra and Nagar Haveli", "Daman and Diu", "Delhi", "Goa", "Gujarat", "Haryana", "Himachal Pradesh", "Jammu & Kashmir", "Jharkhand", "Karnataka", "Kerala", "Lakshadweep", "Madhya Pradesh", "Maharashtra", "Manipur", "Meghalaya", "Mezoram", "Nagaland", "Odisha", "Puducherry", "Punjab", "Rajasthan", "Sikkim", "Tamilnadu", "Telengana", "Tripura", "Uttar Pradesh", "Uttarakhand", "West Bengal");

// Cites
var s_a = new Array();
s_a[0]="";

//Andaman and Nicobar Island
s_a[1]=" Port Blair";

//Andhra Pradesh
s_a[2]=" Adilabad | Adoni| Amadalavalasa | Amalapuram | Anakapalle | Anantapur | Badepalle |Banganapalle |Bapatla | Bellampalle | Bethamcherla | Bhadrachalam | Bhainsa | Bheemunipatnam | Bhimavaram | Bhongir | Bobbili| Bodhan | Chapirevula | Chilakaluripet | Chirala | Chittoor | Cuddapah | Devarakonda | Dharmavaram | Eluru | Farooqnagar | Gadwal | Gooty | Gudivada | Gudur | Guntakal | Guntur | Hanuman Junction | Hindupur | Hyderabad* | Ichchapuram | Jaggaiahpet | Jagtial | Jammalamadugu | Jangaon | Kadapa | Kadiri | Kagaznagar | Kakinada | Kalyandurg | Kamareddy | Kandukur | Karimnagar | Kavali | Khammam | Kodad | Koratla | Kothagudem | Kothapeta | Kovvur | Kurnool | Kyathampalle | Macherla | Machilipatnam | Madanapalle | Mahbubnagar | Mancherial | Mandamarri | Mandapeta | Mangalagiri | Manuguru | Markapur | Medak | Miryalaguda | Mogalthur | Nagari | Nagarkurnool | Nandyal | Narasapur | Narasaraopet | Narayanpet | Narsipatnam | Nellore | Nidadavole | Nirmal | Nizamabad | Nuzvid | Ongole | Palacole | Palasa Kasibugga | Palwancha | Parvathipuram | Pedana | Peddapuram | Pithapuram | Pondur | Ponnur | Proddatur | Punganur | Puttur | Rajahmundry | Rajam | Rajampet | Ramachandrapuram | Ramagundam | Rayachoti | Rayadurg | Renigunta | Repalle | Sadasivpet | Salur | Samalkot | Sangareddy | Sattenapalle | Siddipet | Singapur | Sircilla | Srikakulam | Srikalahasti | Srisailam Project (Right Flank Colony) Township | Suryapet | Tadepalligudem | Tadpatri | Tandur | Tanuku | Tenali | Tirupati | Tiruvuru | Tuni | Uravakonda | Venkatagiri | Vicarabad | Vijayawada | Vinukonda | Visakhapatnam | Vizianagaram | Wanaparthy | Warangal ";

//Arunachal Pradesh
s_a[3]=" Along | Bomdila | Itanagar* | Naharlagun | Pasighat ";

//Assam
s_a[4]=" Abhayapuri | Amguri | Anandnagaar | Barpeta | Barpeta Road | Bilasipara | Bongaigaon | Dhekiajuli | Dhubri | Dibrugarh | Digboi | Diphu | Dispur* | Duliajan Oil Town |Gauripur | Goalpara | Golaghat | Guwahati | Haflong | Hailakandi | Hojai | Jorhat | Karimganj | Kokrajhar | Lanka | Lumding | Mangaldoi | Mankachar | Margherita | Mariani | Marigaon | Nagaon | Nalbari | North Lakhimpur | Rangia | Sibsagar | Silapathar | Silchar | Tezpur | Tinsukia ";

//Bihar
s_a[5]=" Amarpur | Araria | Areraj | Arrah | Asarganj| Aurangabad| Bagaha| Bahadurganj| Bairgania| Bakhtiarpur| Banka| Banmankhi Bazar| Barahiya| Barauli| Barbigha| Barh| Begusarai| Behea| Bettiah| Bhabua| Bhagalpur| Bihar Sharif| Bikramganj| Bodh Gaya| Buxar| Chandan Bara| Chanpatia| Chhapra| Colgong| Dalsinghsarai| Darbhanga| Daudnagar| Dehri-on-Sone| Dhaka| Dighwara| Dumraon| Fatwah| Forbesganj| Gaya| Gogri Jamalpur| Gopalganj| Hajipur| Hilsa| Hisua| Islampur| Jagdispur| Jamalpur| Jamui| Jehanabad| Jhajha| Jhanjharpur| Jogabani| Kanti| Katihar| Khagaria| Kharagpur|  Kishanganj| Lakhisarai| Lalganj| Madhepura| Madhubani| Maharajganj| Mahnar Bazar| Makhdumpur| Maner| Manihari| Marhaura| Masaurhi| Mirganj| Mohania| Mokama| Mokameh| Motihari| Motipur| Munger| Murliganj| Muzaffarpur| Narkatiaganj| Naugachhia| Nawada| Nokha| Patna*| Piro| Purnia| Rafiganj|  Rajgir| Ramnagar| Raxaul Bazar |  Revelganj | Rosera | Saharsa | Samastipur | Sasaram | Sheikhpura |  Sheohar | Sherghati | Silao | Sitamarhi | Siwan |  Sonepur | Sugauli | Sultanganj | Supaul| Warisaliganj ";

//Chandigarh
s_a[6]="";

//Chattisgarh
s_a[7]=" Ahiwara | Akaltara| Ambagarh Chowki|  Ambikapur| Arang| Bade Bacheli| Balod| Baloda Bazar| Basna| Bemetra| Bhatapara| Bhilai| Bilaspur| Birgaon| Champa| Chirmiri| Dalli-Rajhara| Dhamtari| Dipka| Dongargarh| Durg-Bhilai Nagar| Gobranawapara| Jagdalpur|  Janjgir| Jashpurnagar| Kanker| Kawardha| Kondagaon| Korba| Mahasamund| Mahendragarh|  Mungeli|  Naila Janjgir| Raigarh| Raipur*| Rajnandgaon| Sakti| Tilda Newra";

//Dadra and Nagar Haveli
s_a[8]=" Amli | Silvassa* ";

//Daman and Diu
s_a[9]=" Daman and Diu";

//Delhi
s_a[10]=" Asola | Bhajanpura | New Delhi* ";

//Goa
s_a[11]=" Aldona| Curchorem Cacora | Goa Velha | Madgaon | Mapusa | Margao | Marmagao | Panaji* ";

// Gujrat
s_a[12]=" Ahmedabad| Amreli| Anand| Ankleshwar| Bharuch| Bhavnagar| Bhuj| Cambay| Dahod| Deesa| Dehgam| Dharampur| Dholka| Dwarka| Gandhidham| Gandhinagar*| Godhra| Himatnagar| Idar| Jamnagar| Junagadh| Kadi| Kalavad| Kalol| Kapadvanj| Karjan| Keshod| Khambhalia| Khambhat| Kheda|Khedbrahma|  Kheralu|  Kodinar|  Lathi| Limbdi| Lunawada| Mahesana| Mahuva| Manavadar| Mandvi|Mangrol|Mansa|Mehmedabad|Mithapur|Modasa|Morvi|Nadiad|Navsari|Padra|Palanpur|Palitana| Pardi| Patan| Petlad| Porbandar| Radhanpur| Rajkot| Rajpipla| Rajula| Ranavav| Rapar| Salaya|Sanand| Savarkundla| Sidhpur| Sihor| Songadh| Surat| Talaja| Thangadh| Tharad| Umbergaon| Umreth| Una| Unjha| Upleta| Vadnagar| Vadodara| Valsad| Vapi| Vapi| Veraval| Vijapur| Viramgam| Visnagar| Vyara| Wadhwan| Wankaner| Adalaj| Adityana| Alang| Ambaji| Ambaliyasan| Andada| Anjar| Anklav| Antaliya| Arambhada| Atul"; 

//Haryana
s_a[13]=" Asankhurd| Assandh| Ateli| Babiyal| Bahadurgarh| Ballabhgarh| Barwala| Bawal| Bhiwani| Charkhi Dadri| Cheeka| Ellenabad| Faridabad| Fatehabad| Ganaur| Gharaunda| Gohana| Gurgaon| Haibat(Yamuna|Nagar)| Hansi| Hisar| Hodal| Jagadhri| Jhajjar| Jind| Kaithal| Kalan Wali| Kalka| Karnal| Ladwa| Mahendragarh| Mandi Dabwali| Manesar| Narnaul| Narwana| Palwal| Panchkula| Panipat| Pehowa| Pinjore| Rania| Ratia| Rewari| Rohtak| Safidon| Samalkha| Shahbad| Sirsa| Sohna| Sonipat| Taraori| Thanesar| Tohana";

//Himachal Pradesh
s_a[14]=" Arki| Baddi| Bilaspur| Chamba| Dalhousie| Dharamsala| Hamirpur| Keylong| Mandi| Nahan| Shimla*| Solan| Sundarnagar";

//Jammu and Kashmir
s_a[15]=" Achabbal| Akhnoor| Anantnag| Arnia| Awantipora| Bandipore| Baramula| Jammu| Kathua| Leh| Punch| Rajauri| Sopore| Srinagar*| Udhampur";

//Jharkhand
s_a[16]=" Amlabad| Ara| Barughutu| Bokaro Steel City| Chaibasa| Chakradharpur| Chandil| Chandrapura| Chatra| Chirkunda| Churi| Daltonganj| Deoghar| Dhanbad| Dumka| Garhwa| Ghatshila| Giridih| Godda| Gomoh| Gumia| Gumla| Hazaribag| Hussainabad| Jamshedpur| Jamtara| Jhumri Tilaiya| Khunti| Lohardaga| Madhupur| Mihijam| Musabani| Pakaur| Patratu| Phusro| Ramngarh| Ranchi*| Sahibganj| Saunda| Simdega| Tenu Dam-cum- Kathhara ";

//Karnatka
s_a[17]=" Aalanavara| Adyar| Afzalpura| Alandha| Alur| Ambikaanagara| Anekal| Ankola| Annigeri|Arkalgud| Arsikere| Athni| Aurad| Ballary| Belagaavi| Bengalooru| Bidar| Chamarajanagara| Chikkaballapura| Chikkamagalur| Chikkodi| Chinthaamani| Chithradurga| Davanageray| Dharwad| Gadhaga| Gokak|Gulbarga| Gundlupet| Haasana| Hosapet| Hubbali| Kaarawaara| Kaarkala| Kalburgi| Kolaara| Kota| Lakshmishawara| Lingsuguru| Maagadi| Maaluru| Maanvi| Maddhuru| Madhugiri| Madikeri| Mahalingapura| Malavalli| Mandya| Mangalooru| Mudabidri| Mudalagi| Muddebihala| Mudhola| Mulabaagilu| Mundaragi| Myooru| Nanjanagoodu| Nippani| Paavagada| pereyaapatna| Puthooru| Raamadurga| Raamanagara| Raayachuru| Rabakavi Banahatti| Ranibennur| Robertson Pet| Ron| Saagara| Sadalaga| Sakaleshapura| Sandur| Sankeshwara| Savanur| Sedam| Shahabad| Shahapura| Sheraguppa| Shiggaavi| Shikapur| Shivamogga| Shree Rangapattana| Shreenivaasapura| Sidhalaghatta| Sindhagi| Sindhanooru| Sira| Sirsi| Soudaththi-Yellamma| Surapura| Tarikere| Tekkalakote| Thaalikote| Thergallu| Thipatooru| Thumakooru| Udupi| Vijayapura| Wadi";

//kerala
s_a[18]=" Adoor| Akathiyoor| Alappuzha| Ancharakandy| Aroor| Ashtamichira| Attingal| Avinissery| Chalakudy| Changanassery| Chendamangalam| Chengannur| Cherthala| Cheruthazham| Chittur-Thathamangalam| Chockli| Erattupetta| Guruvayoor| Irinjalakuda| Kadirur| Kalliasseri| Kalpetta| Kanhangad| Kanjikkuzhi| Kannur| Kasaragod| Kayamkulam| Kochi| Kodungallur| Kollam| Koothuparamba| Kothamangalam| Kottayam| Kozhikode| Kunnamkulam| Malappuram |Mattannur| Mavelikkara| Mavoor| Muvattupuzha| Nedumangad| Neyyattinkara| Ottappalam| Palai| Palakkad| Panniyannur| Pappinisseri| Paravoor| Pathanamthitta| Payyannur| Peringathur| Perinthalmanna| Perumbavoor| Ponnani| Punalur| Quilandy| Shoranur| Taliparamba| Thiruvalla| Thiruvananthapuram| Thodupuzha| Thrissur| Tirur| Vadakara| Vaikom| Varkala ";

//Lakshwadeep
s_a[19]=" Amini | Kavaratti* ";

//Madhya Pradesh
s_a[20]=" Ashok Nagar| Balaghat| Barwani| Betul| Bhopal*| Burhanpur| Chhatarpur| Chhindwara| Chitrakoot| Dabra| Damoh| Datia| Dewas| Dhar| Fatehabad| Guna| Gwalior| Harda| Indore| Itarsi| Jabalpur| Jhabua| Kailaras| Katni| Khurai| Kotma| Lahar| Lundi| Maharajpur| Mahidpur| Maihar| Malajkhand| Manasa| Manawar| Mandideep| Mandla| Mandsaur|Mauganj| Mhow Cantonment| Mhowgaon| Morena| Multai| Murwara| Nagda| Nainpur| Narsinghgarh| Narsinghgarh| Neemuch| Nepanagar| Niwari| Nowgong| Nowrozabad| Pachore| Pali| Panagar| Pandhurna| Panna| Pasan| Pipariya| Pithampur| Porsa| Prithvipur| Raghogarh-Vijaypur| Rahatgarh| Raisen| Rajgarh| Ratlam| Rau| Rehli| Rewa| Sabalgarh| Sagar| Sanawad| Sarangpur| Sarni| Satna| Sausar| Sehore| Sendhwa| Seoni| Seoni-Malwa| Shahdol| Shajapur| Shamgarh| Sheopur| Shivpuri| Shujalpur| Sidhi| Sihora| Singrauli| Sironj| Sohagpur| Tarana| Tikamgarh| Ujhani| Ujjain| Umaria| Vidisha| Wara Seoni ";

//Maharashtra
s_a[21]=" Achalpur|Ahmednagar| Ahmedpur| Ajra| Akkalkot| Akola| Akot| Alandi| Alibag| Amalner| Ambad| Ambejogai| Ambivali Tarf Wankhal| Amravati| Anjangaon | Arvi| Ashta| Aurangabad| Ausa| Baramati| Bhandara| Bhiwandi| Bhusawal| Chalisgaon| Chandrapur| Chinchani| Chiplun| Daund| Devgarh| Dhule| Dombivli| Durgapur| Gadchiroli| Ghatanji| Gondiya| Ichalkaranji| Jalgaon| Jalna| Junnar| Kalyan| Kamthi| Karad| karjat| Kolhapur| Latur| Loha| Lonar| Lonavla| Mahabaleswar| Mahad| Mahuli| Malegaon| Malkapur| Manchar| Mangalvedhe| Mangrulpir| Manjlegaon| Manmad| Manwath| Mehkar| Mhaswad| Mira-Bhayandar| Miraj| Morshi| Mukhed| Mul| Mumbai| Murtijapur| Nagpur| Nalasopara| Nanded-Waghala| Nandgaon| Nandura| Nandurbar| Narkhed| Nashik| Navi|Mumbai| Nawapur| Nilanga| Osmanabad| Ozar| Pachora| Paithan| Palghar| Pandharkaoda| Pandharpur| Panvel| Parbhani| Parli| Parola| Partur| Pathardi| Pathri| Patur| Pauni| Pen| Phaltan| Pulgaon| Pune| Purna| Pusad| Raichuri| Rajura| Ramtek| Ratnagiri| Raver| Risod| Sailu| Sangamner| Sangli| Sangole| Sasvad| Satana| Satara| Savner| Sawantwadi| Shahade| Shegaon| Shendurjana| Shirdi| Shirpur-Warwade| Shirur| Shrigonda| Shrirampur| Sillod| Sinnar| Solapur| Soyagaon| Talegaon Dabhade| Talode| Tasgaon| Tirora| Tuljapur| Tumsar| Uchgaon| Udgir| Umarga| Umarkhed| Umred| Uran| Uran Islampur| Vadgaon Kasba| Vaijapur| Vasai| Virar| Vita| Wadgaon Road| Wai| Wani| Wardha| Warora| Warud| Washim ";

//Manipur
s_a[22]=" Imphal*| Kakching| Lilong| Mayang Imphal| Thoubal"; 

//Meghalaya
s_a[23]=" Jowai| Nongstoin| Shillong* | Tura";

//Mizoram
s_a[24]=" Aizawl| Champhai| Lunglei| Saiha ";

//Nagaland
s_a[25]="Dimapur| Kohima*| Mokokchung| Tuensang| Wokha ";

//Orissa
s_a[26]=" Anandapur| Anugul| Asika| Balangir| Balasore| Baleshwar| Bamra| Barbil| Bargarh| Bargarh| Baripada| Basudebpur| Belpahar| Berhampur| Bhadrak| Bhawanipatna| Bhuban| Bhubaneswar*| Biramitrapur| Brahmapur| Brajrajnagar| Burla| Byasanagar| Cuttack| Debagarh| Dhenkanal| Ganjam| Gunupur| Hinjilicut| Jagatsinghapur| Jajapur| Jaleswar| Jatani| Jeypur| Jharsuguda| Joda| Kantabanji| Karanjia| Kendrapara| Kendujhar| Khordha| Koraput| Kuchinda| Madhyamgram| Malkangiri| Nabarangapur| Paradip| Parlakhemundi| Pattamundai| Phulabani| Puri| Rairangpur| Rajagangapur| Raurkela| Rayagada| Sambalpur| Soro| Sunabeda| Sundargarh| Talcher| Titlagarh| Umarkote";

//Pondicherry 
s_a[27]=" Karaikal| Mahe| Pondicherry* ";

//Punjab
s_a[28]=" Ahmedgarh| Amritsar| Barnala| Batala| Bathinda| Bhagha Purana| Budhlada| Chandigarh*| Dasua| Dhuri| Dinanagar| Faridkot| Fazilka| Firozpur| Firozpur Cantt.| Giddarbaha| Gobindgarh| Gurdaspur| Hoshiarpur| Jagraon| Jaitu| Jalalabad| Jalandhar| Jalandhar Cantt.| Jandiala| Kapurthala| Karoran| Kartarpur| Khanna| Kharar| Kot Kapura| Kurali| Longowal| Ludhiana| Malerkotla| Malout| Mansa| Maur| Moga| Mohali| Morinda| Mukatsar| Mukerian| Muktsar| Nabha| Nakodar| Nangal| Nawanshahr| Pathankot| Patiala| Patran| Patti| Phagwara| Phillaur| Qadian| Raikot| Rajpura| Rampura Phul| Rupnagar| Samana| Sangrur| Sirhind Fatehgarh Sahib| Sujanpur| Sunam| Talwara| Tarn Taran| Urmar Tanda";

//Rajasthan
s_a[29]=" Ajmer| Alwar| Bali| Bandikui| Banswara| Baran| Barmer| Beawar| Bharatpur| Bhilwara| Bhinmal| Bikaner| Bilara| Churu| Devgarh| Falna| Fatehpur| Hanumangarh| Harsawa| Jaipur*| Jaisalmer| Jaitaran| Jalore| Jhalawar| Jhunjhunu| Jodhpur| Kota| Lachhmangarh| Ladnu| Lakheri| Lalsot| Losal| Mahwa| Makrana| Malpura| Mandalgarh| Mandawa| Mangrol| Merta City| Mount Abu| Nadbai| Nagar| Nagaur| Nargund| Nasirabad| Nathdwara| Navalgund| Nawalgarh| Neem-Ka-Thana| Nelamangala| Nimbahera| Niwai| Nohar| Nokha| Pali| Phalodi| Phulera| Pilani| Pilibanga| Pindwara| Pipar City| Prantij| Pratapgarh| Raisinghnagar| Rajakhera| Rajaldesar| Rajgarh (Alwar)| Rajgarh (Churu)| Rajsamand| Ramganj Mandi| Ramngarh| Ratangarh| Rawatbhata| Rawatsar| Reengus| Sadri| Sadulshahar| Sagwara| Sambhar| Sanchore| Sangaria| Sardarshahar| Sawai Madhopur| Shahpura| Shahpura| Sheoganj| Sikar| Sirohi| Sojat| Sri Madhopur| Sujangarh| Sumerpur| Suratgarh| Taranagar| Todabhim| Todaraisingh| Tonk| Udaipur| Udaipurwati| Vijainagar"; 

//Sikkim 
s_a[30]=" Gangtok* ";

//Tamil Nadu
s_a[31]=" Arakkonam| Arcot| Aruppukkottai| Bhavani| Chengalpattu| Chennai*| Chinna salem| Coimbatore| Coonoor| Cuddalore| Dharmapuri| Dindigul| Erode| Gudalur| Kanchipuram| Karaikudi| Karungal| Karur| Kollankodu| Lalgudi| Madurai| Nagapattinam| Nagercoil| Namagiripettai| Namakkal| Nandivaram-Guduvancheri| Nanjikottai| Natham| Nellikuppam| Neyveli| O' Valley| Oddanchatram| P.N.Patti| Pacode| Padmanabhapuram| Palani| Palladam| Pallapatti| Pallikonda| Panagudi| Panruti| Paramakudi| Parangipettai| Pattukkottai| Perambalur| Peravurani|  Periyakulam|  Periyasemur| Pernampattu| Pollachi| Polur| Ponneri| Pudukkottai| Pudupattinam| Puliyankudi| Punjaipugalur| Rajapalayam| Ramanathapuram| Rameshwaram| Rasipuram| Salem| Sankarankoil| Sankari| Sathyamangalam| Sattur| Shenkottai| Sholavandan| Sholingur| Sirkali| Sivaganga| Sivagiri| Sivakasi| Srivilliputhur| Surandai| Suriyampalayam| Tenkasi| Thammampatti| Thanjavur| Tharamangalam| Tharangambadi| Theni Allinagaram| Thirumangalam| Thirunindravur| Thiruparappu| Thirupuvanam| Thiruthuraipoondi| Thiruvallur| Thiruvarur| Thoothukudi| Thuraiyur| Tindivanam| Tiruchendur| Tiruchengode| Tiruchirappalli| Tirukalukundram| Tirukkoyilur| Tirunelveli| Tirupathur| Tiruppur| Tiruttani| Tiruvannamalai| Tiruvethipuram| Tittakudi| Udhagamandalam| Udumalaipettai| Unnamalaikadai| Usilampatti| Uthamapalayam| Uthiramerur| Vadakkuvalliyur| Vadalur| Vadipatti| Valparai| Vandavasi| Vaniyambadi| Vedaranyam| Vellakoil| Vellore|  Vikramasingapuram| Viluppuram| Virudhachalam| Virudhunagar| Viswanatham";

//Telengana
s_a[32]="";

//Tripura
s_a[33]=" Agartala| Badharghat| Dharmanagar| Indranagar| Jogendranagar| Kailasahar| Khowai| Pratapgarh| Udaipur";

//Uttar Pradesh
s_a[34]=" Achhnera| Adari| Agra| Aligarh| Allahabad| Amroha| Azamgarh| Badaun| Bahraich| Ballia| Balrampur| Banda| Bareilly| Bharthana| Bijnaur| Budaun| Bulandshahr| Chakeri| Chandausi| Charkhari| Dadri| Deoria| Etah| Etawah| Faizabad| Farrukhabad| Fatehabad| Fatehgarh| Fatehpur| Fatehpur Chaurasi| Fatehpur Sikri| Firozabad| Ghatampur| Ghaziabad| Ghazipur| Gorakhpur| Greater Noida| Hamirpur| Hardoi| Hastinapur| Hathras| Jais| Jajmau| Jaunpur| Jhansi| Kalpi| Kanpur| Kheri| Kota| Laharpur| Lakhimpur| Lal Gopalganj Nindaura| Lalganj| Lalitpur| Lar| Loni| Lucknow*| Mahoba| Mathura| Meerut| Mirzapur| Modinagar| Moradabad| Muradnagar| Muzaffarnagar| Nagina| Najibabad| Nakur| Nanpara| Naraura| Naugawan Sadat| Nautanwa| Nawabganj| Nehtaur| Noida| Noorpur| Obra| Orai| Padrauna| Palia Kalan| Parasi| Phulpur| Pihani| Pilibhit| Pilkhuwa| Powayan| Pukhrayan| Puranpur| Purquazi| Purwa| Rae Bareli| Rampur| Rampur Maniharan| Rasra| Rath| Renukoot| Reoti| Robertsganj| Rudauli| Rudrapur| Sadabad| Safipur| Saharanpur| Sahaspur| Sahaswan| Sahawar| Sahjanwa| Saidpur| Sambhal| Samdhan| Samthar| Sandi| Sandila| Sardhana| Seohara| Shahabad, Hardoi| Shahabad, Rampur| Shahganj| Shahjahanpur| Shamli| Shamsabad, Agra| Shamsabad, Farrukhabad| Sherkot| Shikarpur, Bulandshahr| Shikohabad| Shishgarh| Siana| Sikanderpur| Sikandra Rao| Sikandrabad| Sirsaganj| Sirsi| Sitapur| Soron| Suar| Sultanpur| Sumerpur| Tanda| Tetri Bazar| Thakurdwara| Thana Bhawan| Tilhar| Tirwaganj| Tulsipur| Tundla| Unnao| Utraula| Varanasi| Vrindavan| Warhapur";

//Uttarakhand 
s_a[35]=" Almora| Bazpur| Chamba| Champawat| Dehradun| Haldwani| Haridwar| Jaspur| Kashipur| kichha| Kotdwara| Manglaur| Mussoorie| Nagla| Nainital| Pauri| Pithoragarh| Ramnagar| Rishikesh| Roorkee| Rudrapur| Sitarganj| Tehri";

//West Bengal
s_a[36]=" Adra| Alipurduar| Arambagh| Asansol| Baharampur| Bally| Balurghat| Bankura| Barakar| Barasat| Bardhaman| Barrackpur| Bidhan Nagar| Chinsura| Contai| Cooch|Behar| Dalkhola| Darjeeling| Dhulian| Dumdum| Durgapur| Haldia| Howrah| Hugli-Chuchura| Islampur| Jhargram| Kalimpong| Kharagpur| Kolkata*| Konnagar| Krishnanagar| Mainaguri| Mal| Mathabhanga| Medinipur| Memari| Monoharpur| Murshidabad| Pandua| Paschim Punropara| Purulia| Raghunathpur| Raiganj| Rampurhat| Ranaghat| Sainthia| Santipur| Siliguri| Sonamukhi| Srirampore| Suri| Taki| Tamluk| Tarakeswar ";

s_a[105]="Andaman and Nicobar Islands|Andhra Pradesh|Arunachal Pradesh|Assam|Bihar|Chandigarh|Chhattisgarh|Dadra and Nagar Haveli|Daman and Diu|Delhi|Goa|Gujarat|Haryana|Himachal Pradesh|Jammu and Kashmir|Jharkhand|Karnataka|Kerala|Lakshadweep|Madhya Pradesh|Maharashtra|Manipur|Meghalaya|Mizoram|Nagaland|Orissa|Pondicherry|Punjab|Rajasthan|Sikkim|Tamil Nadu|Tripura|Uttar Pradesh|Uttaranchal|West Bengal";

function populateCities( stateElementId, cityElementId ){
	
	var selectedStateIndex = document.getElementById( stateElementId ).selectedIndex;

	var cityElement = document.getElementById( cityElementId );
	
	cityElement.length=0;	// Fixed by Julian Woods
	cityElement.options[0] = new Option('Select City','');
	cityElement.selectedIndex = 0;
	
	var city_arr = s_a[selectedStateIndex].split("|");
	
	for (var i=0; i<city_arr.length; i++) 
	{
		cityElement.options[cityElement.length] = new Option(city_arr[i],city_arr[i]);
	}
}

function populateStates(stateElementId, cityElementId){
	// given the id of the <select> tag as function argument, it inserts <option> tags
	var stateElement = document.getElementById(stateElementId);
	stateElement.length=0;
	stateElement.options[0] = new Option('Select State','-1');
	stateElement.selectedIndex = 0;
	for (var i=0; i<state_arr.length; i++) {
		stateElement.options[stateElement.length] = new Option(state_arr[i],state_arr[i]);
	}

	// Assigned all countries. Now assign event listener for the states.

	if( cityElementId ){
		stateElement.onchange = function(){
			populateCities( stateElementId, cityElementId );
		};
	}
}